<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="template.xhtml">
	
	
	
		<style type="text/css">
			.old{
  				background:#fafafa;
  				}
		</style>
	
	<ui:define name="content">
	
		<h:form prependId="false">
			<p:panel header="Search Drivers">
				<h:panelGrid columns="3">
					<h:outputText value="Driving License Num: " />
					<p:autoComplete value="#{manageDrivers.dlNo}" completeMethod="#{manageDrivers.getDriverbyDLNo}"/>
					<p:commandButton value="Search" actionListener="#{manageDrivers.search}"/>
				</h:panelGrid>
			</p:panel>
			
			<p:dataTable id="driver"  var="driver" value="#{manageDrivers.drivers}" rows="5" paginator="true" 
			rowStyleClass="#{driver.isBlacklisted == true ? 'old' : null}"
                         selection="#{manageDrivers.selectedDrivers}" selectionMode="multiple">
                
                <p:column sortBy="#{driver.driverDlNo}" filterBy="#{driver.driverDlNo}">
					<f:facet name="header">
						<h:outputText value="Driver DL No" />  
					</f:facet>
					<h:outputText value="#{driver.driverDlNo}"></h:outputText>
				</p:column>
                
                <p:column>
					<f:facet name="header">
						<h:outputText value="Driver Name" />
					</f:facet>
					<h:outputText value="#{driver.driverName}"></h:outputText>
				</p:column>
				
				<p:column>
					<f:facet name="header">
						<h:outputText value="Mobile No" />
					</f:facet>
					<h:outputText value="#{driver.driverMobileNo}"></h:outputText>
				</p:column>
				
				<p:column>
					<f:facet name="header">
						<h:outputText value="DL Exp date" />
					</f:facet>
					<h:outputText value="#{driver.driverDlExpDate}"></h:outputText>
				</p:column>
				
				<p:column>
					<f:facet name="header">
						<h:outputText value="Blacklisted" />
					</f:facet>
					<h:outputText value="#{driver.isBlacklisted}"></h:outputText>
				</p:column>
				
				
				
			</p:dataTable>
			<br />
		</h:form>
	</ui:define>

</ui:composition>